import DList from "@/components/dlist";
export default {
  data() {
    return {
    };
  },
  mounted() {
  },
  methods: {
    toScanCode() {
      let that = this;
      if (!this.fun.isWeiXin()) {
        this.$dialog.alert({
          message: "请使用微信浏览器打开"
        });
      } else {
        wx.ready(function () {
          wx.scanQRCode({
            desc: "scanQRCode desc",
            needResult: 1, // 默认为0，扫描结果由企业微信处理，1则直接返回扫描结果，
            scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码，默认二者都有
            success: function (res) {
              console.log(res,'扫描');
              that.$router.push(
                that.fun.getUrl("receiptNumber", { express_sn : res.resultStr.split(",")[1] } , { })
              );
            },
            error: function (err) {
              console.log(err);
              //轻提示
              that.$dialog.alert({
                message: "请使用微信浏览器"
              });
            }
          }); //wx.scanQRcode结束
        });
      }
    },
    goRecord() {
      this.$router.push(
        this.fun.getUrl("scanRecord", {})
      );
    }
  },
  components: { DList }
};
